var Method = {
    "getQueryString":function(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return r[2];
        }
        return null;
    },
    "getJosn":function(str) {
        if (typeof str == "string") {
            return JSON.parse(str);
        } else {
            return str;
        }
    }
};
Date.prototype.toLocaleString = function() {  //时间格式
      return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate() + " " + this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds() ;
};
$("#download").on("click",function(){
	goto();
});
function goto(){
		var ua = navigator.userAgent;
		if(ua.match(/iPhone|iPod/i) != null){
			window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.cool.coolqi";
		}
		else if(ua.match(/Android/i) != null){
			window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.cool.coolqi";
		}
		else if(ua.match(/iPad/i) != null){		
			window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.cool.coolqi";
		}
//					else if(ua.match(/MicroMessenger/i) =! null){
//						    alert('请使用浏览器打开后进行下载');
//					} 
	}